﻿<phone:PhoneApplicationPage
    x:Class="MobiSms.Wasun.Views.SerialAddView"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:UX="clr-namespace:MobiSms.UX;assembly=MobiSms.UX"
    xmlns:viewmodel="clr-namespace:MobiSms.ViewModel;assembly=MobiSms.ViewModel"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
    SupportedOrientations="Portrait" Orientation="Portrait"
    mc:Ignorable="d"
    shell:SystemTray.IsVisible="False" d:DesignHeight="800" d:DesignWidth="480">

    <!--LayoutRoot is the root grid where all page content is placed-->
    <Grid x:Name="LayoutRoot">
        <Grid.Background>
            <ImageBrush ImageSource="{Binding GlobalSettings.BackgroundImage}" Stretch="{Binding GlobalSettings.BackgroundImageStretch}" />
        </Grid.Background>
        <Grid.DataContext>
            <viewmodel:SerialAddViewModel/>
        </Grid.DataContext>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>

        <!--TitlePanel contains the name of the application and page title-->
        <StackPanel Grid.Row="0" Margin="12,17,0,28">
            <TextBlock Text="{StaticResource IDS_APP_NAME}" Style="{StaticResource PhoneTextNormalStyle}"/>
            <TextBlock Text="{StaticResource IDS_SERIAL_ADD}" Margin="9,-7,0,0" Style="{StaticResource PhoneTextTitle1Style}"/>
        </StackPanel>

        <!--ContentPanel - place additional content here-->
        <Grid Grid.Row="1" Margin="12,0,12,0">
            <Grid.ColumnDefinitions>
                <ColumnDefinition/>
                <ColumnDefinition Width="auto"/>
            </Grid.ColumnDefinitions>
            <ScrollViewer>
                <StackPanel>
                    <TextBlock Style="{StaticResource PhoneTextSubtleStyle}" Text="{StaticResource IDS_SERIAL_SERIAL}" />
                    <TextBox Text="{Binding SerialItemToAdd.SerialNumber, Mode=TwoWay}" InputScope="LogOnName" />
                    <TextBlock Style="{StaticResource PhoneTextSubtleStyle}" Text="{StaticResource IDS_SERIAL_PASSWORD}" />
                    <TextBox Text="{Binding SerialItemToAdd.Password, Mode=TwoWay}" InputScope="Number" />
                    <TextBlock Style="{StaticResource PhoneTextSubtleStyle}" Text="{StaticResource IDS_SERIAL_SIGNATURE}" />
                    <TextBox Text="{Binding SerialItemToAdd.Signature, Mode=TwoWay}" />
                    <TextBlock Style="{StaticResource PhoneTextSubtleStyle}" Text="{StaticResource IDS_SERIAL_SERVICECODE}" />
                    <TextBox Text="{Binding SerialItemToAdd.ServiceCode, Mode=TwoWay}" InputScope="Number" />
                </StackPanel>
            </ScrollViewer>

            <StackPanel VerticalAlignment="Bottom" Margin="0,12">
                <TextBlock Style="{StaticResource PhoneTextTitle2Style}" Text="{StaticResource IDS_SERIAL_BALANCE}" />
                <TextBlock Style="{StaticResource PhoneTextNormalStyle}" Text="{Binding SerialItemToAdd.Balance}" />
            </StackPanel>
            
            <StackPanel Grid.Column="1" VerticalAlignment="Bottom">
                
                <UX:UXPathButton IconPath="{StaticResource PATH_ICON_CLOSE}" 
                                 Command="{Binding CancelCommand}"
                                 Padding="14" Margin="12,0,12,12"/>
                <UX:UXPathButton IconPath="{StaticResource PATH_ICON_SUBMIT}" 
                                 Margin="12,0,12,12" 
                                 Command="{Binding InsertCommand, Mode=OneWay}"/>
                <UX:UXPathButton IconPath="{StaticResource PATH_ICON_REFRESH}" 
                                 Command="{Binding BalanceCommand}"
                                 Margin="12,0,12,12"/>
            </StackPanel>
        </Grid>
    </Grid>

</phone:PhoneApplicationPage>